home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1988 / Jun 88 / Appletalk in MacApp 5⁄9 < prev    next >
Encoding:
Text File  |  1991-03-06  |  3.6 KB  |  133 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  MARRIOTT1    to BOYD3
  2.  
  3. Item    0993865                         9-May-88        17:13
  4.  
  5. From:   N0658                           ESL, Robert Penland, ASC
  6.  
  7. To:     MACAPP$                         MacApp Interest List
  8.  
  9. cc:     MACDTS                          Macintosh Developer Technical Supt.
  10.  
  11. Sub:    Appletalk in MacApp
  12.  
  13. Hi again,
  14.  
  15.  
  16.  
  17.     My further adventures into the implementation of the new
  18. appletalk calls in a MacApp unit continue unchecked.  Things are
  19. basically working but the speed is very S--L--O--W.  The rate at
  20. which a call completes seems to be tied to the timeout value
  21. eventhough I am requesting and sending the proper number of
  22. packets.  Could it be the way I am sensing the Appletalk events.
  23. Below are some code fragments from my Appletalk library.  Is
  24. this an acceptable polling method and will it be called often
  25. enough?
  26.  
  27.  
  28.  
  29. {EventHandler Methods}
  30.  
  31. ------------------------------------------------------
  32.  
  33.     PROCEDURE TModTalkHandler.DoIdle(phase: IdlePhase);
  34.  
  35.     BEGIN
  36.     IF fPollForCompletion THEN
  37.                     BEGIN
  38.                         PollForCompletion;
  39.                     END;
  40.     END;
  41.  
  42.  
  43.  
  44.  
  45.  
  46.     PROCEDURE TModTalkHandler.PollForCompletion;
  47.  
  48. {checks for completion of reception of reply from AppleTalk
  49.  
  50.     Request call; by default, this is called during Idle}
  51.  
  52.  
  53.  
  54.         PROCEDURE CheckIt(aTalkCall: TModTalkCall);
  55.             BEGIN
  56.                     aTalkCall.CheckCompletion(FALSE);
  57.             END;
  58.  
  59.  
  60.  
  61. -----------------------------------------------------
  62.  
  63. {TalkCall Method}
  64.  
  65.  
  66.  
  67. PROCEDURE TModTalkCall.CheckCompletion                                (AsyncProcess:BOOLEAN);
  68.  
  69.         VAR aResult:    INTEGER;
  70.     BEGIN
  71.             IF AsyncProcess THEN
  72.                     BEGIN
  73.                             aResult := fATPPBPtr^.ioResult;
  74.                             fTalkHandler.fHeadTalkCall := SELF;
  75.             IF aResult = kCompleted THEN
  76.                                     BEGIN
  77.                                         fTalkHandler.CallSucceeded;
  78.                                     END
  79.                             ELSE
  80.                                     fTalkHandler.CallFailed(aResult);
  81.                     END
  82.         ELSE
  83.                 IF fPending THEN
  84.                         BEGIN
  85.                             aResult := fATPPBPtr^.ioResult;
  86.                             IF aResult <> kStillPending THEN
  87.                                     BEGIN
  88.                                         fTalkHandler.fHeadTalkCall := SELF;
  89.                                         fPending := FALSE;
  90.                                         IF aResult = kCompleted THEN
  91.                                                 BEGIN
  92.                                                             fTalkHandler.CallSucceeded
  93.                                                 END
  94.                                         ELSE
  95.                                                 fTalkHandler.CallFailed(aResult);
  96.  
  97.                                     END;
  98.                       END;
  99.  
  100.     END;
  101.  
  102. --------------------------------------------------------
  103.  
  104.  
  105. This follows the architecture of the original MacApp appletalk unit
  106. with a few changes (parameter blocks are used and polling is the only
  107. method to determine completion, i.e. no Network events)
  108.  
  109. The value passed to checkCompletion tells whether the call was
  110. asynchronous or not.  If it was synchronous checkcompletion is
  111. called with AsyncProcess = TRUE under the assumption that the
  112. completion result is already in the ioResult field of the
  113. ATPParamBlock (given by fATPPBPtr).  It the call was made
  114. asynchronously then checkcompletion is called by the doidle
  115. method with AsyncProcess= FALSE, which continually checks
  116. the ioResult field.  Is this a reasonable approach?  Also, is there
  117. something I need to change in MacApp so that it ignores Network
  118. events?
  119.  
  120.     As an aside, what happens to an appletalk call made to a
  121. computer that is involved in a very lengthy disk I/O procedure.
  122. Also, does the timeout value for a call set some kind of priority
  123. level for the event?
  124.  
  125.  
  126.  
  127.                         Thanks,
  128.  
  129.                             Robert Penland
  130.  
  131.  
  132.  
  133.